package com.jinly.ryder.deploy.dao.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.jinly.ryder.common.dao.entity.BaseDO;
import com.jinly.ryder.deploy.service.model.DeployType;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 部署实例记录
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "deploy_record", autoResultMap = true)
public class DeployRecordDO extends BaseDO {

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 实例ID
     */
    @TableField(value = "instance_id", updateStrategy = FieldStrategy.NEVER)
    private Integer instanceId;

    /**
     * 发布，重启
     */
    @TableField(value = "deploy_type", updateStrategy = FieldStrategy.NEVER)
    private DeployType deployType;

    /**
     * 主机
     */
    @TableField(value = "host", updateStrategy = FieldStrategy.NEVER)
    private String host;

    /**
     * 端口
     */
    @TableField(value = "port", updateStrategy = FieldStrategy.NEVER)
    private Integer port;

    /**
     * 部署申请ID
     */
    @TableField(value = "apply_id", updateStrategy = FieldStrategy.NEVER)
    private Long applyId;

    /**
     * 部署结果
     */
    @TableField(value = "success")
    private Boolean success;

    /**
     * 消息
     */
    @TableField(value = "msg_text")
    private String msgText;

    /**
     * 部署开始时间
     */
    @TableField(value = "begin_time", updateStrategy = FieldStrategy.NEVER)
    private LocalDateTime beginTime;

    /**
     * 部署结束时间
     */
    @TableField(value = "end_time")
    private LocalDateTime endTime;

    /**
     * 操作人
     */
    @TableField(value = "operator", updateStrategy = FieldStrategy.NEVER)
    private Long operator;


}
